<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 引入 bootstrap 样式表 -->
    <link rel="stylesheet" href="./css/bootstrap.min.css" />
  </head>

  <body>
    <button>测试bootstrap的弹框</button>
    <!-- 
        data开头都是自定义属性 
        data-bs-toggle  ==> 切换弹窗
        data-bs-target  ==> 切换哪个弹窗
        data-bs-dismiss  ===> 关掉弹窗
     -->

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
    Launch demo modal
</button>
  
  <!-- Modal -->
  <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1 class="modal-title fs-5" id="exampleModalLabel">我是一个小弹窗</h1>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <!-- 弹窗的内容主体区域 -->
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem enim quos eius, atque provident accusantium illo placeat optio numquam expedita rerum consequuntur aliquid, dolorem saepe maxime deleniti amet? Expedita, libero.
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Save changes</button>
        </div>
      </div>
    </div>
  </div>

    <!-- bootstrap的js -->
    <script src="./lib/bootstrap.min.js"></script>
    <script>
        
    //     1. 自定义属性操作
    //     data开头都是自定义属性 
    //     data-bs-toggle  ==> 切换弹窗
    //     data-bs-target  ==> 切换哪个弹窗
    //     data-bs-dismiss  ===> 关掉弹窗
    //  


         // 用js的方式操作model
        // 实例化一个model对象，
        const myModel = new bootstrap.Modal('#exampleModal')
        // 调用js方法，show , hide 开启 关闭
        setTimeout(() => {
            myModel.show() // 开启
            myModel.hide()
        }, 3000);
    </script>
  </body>
</html>